package com.ruoyi.web.controller.system;

import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.system.domain.Fanningdi;
import com.ruoyi.system.service.IFanningdiService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import java.util.List;

/**
 * 【请填写功能名称】Controller
 * 
 * @author ruoyi
 * @date 2021-10-28
 */
@Controller
@RequestMapping("/system/tianbao")
public class TianbaoPageController extends BaseController
{
    private String prefix = "system/tianbao";

    @GetMapping("/fanninglist")
    public String fanninglist(HttpServletRequest request)
    {
        if(!isLogin(request)) {
            return   "system/formlist/login";
        }
        return prefix + "/fanninglist";
    }

    @GetMapping("/fanningedit")
    public String fanningedit(HttpServletRequest request)
    {
        if(!isLogin(request)) {
            return   "system/formlist/login";
        }
        return prefix + "/fanningedit";
    }

    @GetMapping("/zaiwailist")
    public String zaiwailist(HttpServletRequest request)
    {

        if(!isLogin(request)) {
            return   "system/formlist/login";
        }return prefix + "/zaiwailist";
    }

    @GetMapping("/zaiwaiedit")
    public String zaiwaiedit(HttpServletRequest request)
    {

        if(!isLogin(request)) {
            return   "system/formlist/login";
        }return prefix + "/zaiwaiedit";
    }

    public boolean isLogin(HttpServletRequest request) {
        HttpSession session = request.getSession();
        if (session == null || session.getAttribute("userid") == null) {
            return false;
        }
        return true;
    }
}
